#pragma once
#include "Incl.h"

#define TICK 10

struct GraphicConfig
{
	Uint32 WindowWidth;
	Uint32 WindowHeight;
	Uint32 ColorDepth;
	string WindowName;
};

struct PixPtr
{
	int X;
	int Y;
	
	void Set(int x, int y) {X = x; Y = y;}
	PixPtr(int x, int y) : X(x), Y(y) { }
	PixPtr() { }
};

typedef PixPtr IntPtr2D;

class Engine
{
private:
	Engine();

public:
	GraphicConfig GraphCfg;
	static Engine &Instance();
	SDL_Surface *Viewport;
	SDL_Rect ViewportRect;
	SDL_Event GlobalEventHandler;
	SDL_PixelFormat *PixForm;
	bool IsRunning;

	void EngineInit();
};

//Engine shortcuts
#define E_		Engine::Instance()
#define E_EV	Engine::Instance().GlobalEventHandler
#define E_VP	Engine::Instance().Viewport
#define E_VPR	Engine::Instance().ViewportRect
#define E_RUN	Engine::Instance().IsRunning
#define E_PF	Engine::Instance().PixForm

//Version definitions
#define MAJOR_V 0
#define MINOR_V 1
#define PATCH_V 4